06. AMCL Launch File: Map Server Node

Map Server Node

The first node is the map_server node ( http://wiki.ros.org/map_server) . The map_server node provides map data as a ROS service to other nodes such as the amcl node. Here, map_server node will locate the map you created in the Map Setup step and send it out as the map data.

First, add an argument of the path to your map file so that you could easily change the map loaded and avoid typing long paths again:

<arg name="map_file" default="$(find <YOUR PACKAGE NAME>)/maps/<YOUR MAP NAME>.yaml"/>

Then, add the map_server node, which utilizes the argument you created just now:

<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

Your amcl.launch file should look like this now:

<launch>

  <!-- Map Server -->
  <arg name="map_file" ... />
  <node name="map_server" ... />

</launch>

Nice, we have the map_server node set up. Let's move on to the amcl node.